package cn.itcast.demo02;

import java.io.File;

/*
文件夹的遍历
 */
public class Demo01File {
    public static void main(String[] args) {
        show02();
    }

    private static void show02() {
        File file = new File("E:\\MyApplication4");
        File[] listFiles = file.listFiles();
        for (File listFile : listFiles) {
            System.out.println(listFile);
        }
    }

    private static void show01() {
        File file = new File("E:\\MyApplication4");
        String[] arr = file.list();
        for (String fileName:arr){
            System.out.println(fileName);
        }
    }
}
